﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data;
using DTO;
using System.Data;
namespace Bussiness
{
    public class SachService
    {
        public DataTable SelectSachDetail() {
            SachRepository repository = new SachRepository();
            return repository.SelectSachDetail();
        }

        public List<SachDTO> SelectAllSachs()
        {
            throw new NotImplementedException();
        }
        public DataTable TimKiem(string maSach, string tenSach, int idTacGia, int idTheLoai, int tonItHon, int tonNhieuHon)
        {
            SachRepository sser = new SachRepository();
            return sser.TimKiem(maSach,tenSach,idTacGia,idTheLoai, tonItHon, tonNhieuHon);
            //return sser.TimKiem("t", "a", "", 0);
        }

        //public DataTable BaoCaoTon(int thang, int nam)
        //{
        //    SachRepository sachrep = new SachRepository();
        //    return sachrep.BaoCaoTon(thang, nam);
        //}

        public DataTable BaoCaoTon(int thang, int nam)
        {
            SachRepository sachrep = new SachRepository();
            return sachrep.BaoCaoTon(thang, nam);
        }

        public DataTable GetSachListDetail() {
            SachRepository repository = new SachRepository();
            return repository.GetSachListDetail();
        }

        public string CreateMaSach(string maTheLoai) {
            SachRepository repository = new SachRepository();
            return repository.CreateMaSach(maTheLoai);
        }

        public bool AddNewBook(SachDTO value) {
            SachRepository repository = new SachRepository();
            return repository.AddNewBook(value);
        }
    }
}
